﻿#include "MapModel.h"
#include "TrajectoryPoints.h"

MapModel::MapModel(QObject *parent)
    : QObject{parent}
{
    _trajectoryPoints = new TrajectoryPoints(this, this);
    connect(this, &MapModel::homeCoordinateChanged, _trajectoryPoints, &TrajectoryPoints::homeCoordinateChanged);
    _trajectoryPoints->start();
}

MapModel::~MapModel()
{
}

/**
 * @brief MapModel::updateFlightDistance
 * @param distance
 * @remark
 */
void MapModel::updateFlightDistance(double distance)
{
    _distance += distance;
}

void MapModel::coordinateReceived(QGeoCoordinate coordinate)
{
    emit coordinateChanged(coordinate);
}
